{% extends 'mathtesthome.html' %}
{% block body %}
<div class="main-content container">


    <div class="row">
        <div class="col-md-12">
            <div class="panel panel-default">
                <div class="panel-heading panel-heading-divider">{{title}}<span
                        class="panel-subtitle">{%if score%} 本次测试得分: {{score}}{%endif%}</span>
                </div>

                <div class="panel-body pl-sm-5">
                                            {% if test.questions.all %}
                    <form method='POST' action="{% url 'mathtest:redotestscore' test.id %}" enctype='multipart/form-data'>
                        {% csrf_token %}




                      {% for q in test.questions.all %}
                           <div class="form-group row">
                            <label class="col-12 col-sm-3 col-form-label text-sm-right">{{q}}</label>

                            <div class="col-12 col-sm-8 col-lg-6 form-check mt-2">
                                {%for a in q.answer_set.all %}
                                <label class="custom-control custom-radio custom-control-inline">
                                    <input type="radio" name="{{q.id}}"
                                           class="custom-control-input" value="{{a.id}}" required> <span
                                        class="custom-control-label">{{a}}</span>
                                </label>
                                {%endfor%}
                            </div>

                        </div>
                        {%endfor%}




                        <div class="col-lg-6">
                            <p class="text-right">
                                <button type="submit" class="btn btn-space btn-primary" value="OK">提交</button>
                            </p>
                        </div>

                    </form>
                    {%else%}
                    <label><font color="green" size="6">恭喜你没有错题！！！</font></label>
                    {%endif%}
                </div>

            </div>
        </div>
    </div>
</div>

{% endblock %}